import javax.swing.*;
import javax.swing.text.*;
import java.awt.*;              
import java.awt.event.*;       
import java.net.URL;
import java.io.*;
import java.lang.Object;


class HelpFrame extends JFrame{
                URL helpURL;
                public HelpFrame(String helpIndexFileName){
                        JEditorPane editorPane = new JEditorPane();
                        editorPane.setEditable(false);
                       try {
                                                             
                                helpURL = new File(helpIndexFileName).toURL();
                                if (helpURL != null) {
                                        editorPane.setPage(helpURL);
                                        
                                    } else {
                                        System.err.println("Nie moge znalesc pliku pomocy");
                                        }
                        } catch (IOException e) {
                                        System.err.println("Zly URL " + helpURL);
                                        }
       
                 //dodanie edytorPane do editorScrollePane.
                JScrollPane editorScrollPane = new JScrollPane(editorPane);
                editorScrollPane.setVerticalScrollBarPolicy(
                JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                editorScrollPane.setPreferredSize(new Dimension(250, 145));
                editorScrollPane.setMinimumSize(new Dimension(10, 10));
                getContentPane().add(editorScrollPane);
                setSize(400,400);
                setName("Pomoc");
               
                }
}
